package com.randi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.randi.system.domain.entity.SysUserRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ziye
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {

    /**
     * 获取授权用户ID
     *
     * @param roleId 角色ID
     * @return 结果
     */
    List<Long> selectSysUserRoleByRoleId(Long roleId);

    /**
     * 批量添加授权
     *
     * @param sysUserRoleList SysUserRole集合
     * @return 结果
     */
    int insertBatch(List<SysUserRole> sysUserRoleList);

    /**
     * 批量取消授权
     *
     * @param roleId  角色ID
     * @param userIds 用户id集合
     * @return 结果
     */
    int deleteBatch(Long roleId, @Param("list") List<Long> userIds);
}
